Skip to content

Conversation

@arsenm
Copy link
Contributor

@arsenm arsenm commented Sep 17, 2025

No description provided.

Copy link
Contributor Author

arsenm commented Sep 17, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@llvmbot
Copy link
Member

llvmbot commented Sep 17, 2025

@llvm/pr-subscribers-tools-llvm-exegesis

Author: Matt Arsenault (arsenm)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/159223.diff

1 Files Affected:

  • (modified) llvm/tools/llvm-exegesis/lib/LlvmState.cpp (+5)
diff --git a/llvm/tools/llvm-exegesis/lib/LlvmState.cpp b/llvm/tools/llvm-exegesis/lib/LlvmState.cpp
index 2c6f5d275cf00..d7bf9c1f77b89 100644
--- a/llvm/tools/llvm-exegesis/lib/LlvmState.cpp
+++ b/llvm/tools/llvm-exegesis/lib/LlvmState.cpp
@@ -56,6 +56,11 @@ Expected<LLVMState> LLVMState::Create(std::string TripleName,
 
   std::unique_ptr<MCSubtargetInfo> STI(
       TheTarget->createMCSubtargetInfo(TheTriple, CpuName, ""));
+  if (!STI) {
+    return make_error<StringError>("unable to create subtarget info",
+                                   inconvertibleErrorCode());
+  }
+
   assert(STI && "Unable to create subtarget info!");
   if (!STI->isCPUStringValid(CpuName)) {
     return make_error<StringError>(Twine("invalid CPU name (")

@arsenm arsenm marked this pull request as ready for review September 17, 2025 01:35
Copy link
Contributor

@boomanaiden154 boomanaiden154 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks.

@arsenm arsenm merged commit be6129a into main Sep 17, 2025
13 checks passed
@arsenm arsenm deleted the users/arsenm/llvm-exegesis/error-mcsubtargetinfo-construct-failure branch September 17, 2025 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants